﻿using System;
using System.Collections.Generic;
using DevExpress.Xpo;
using System.Text;

namespace BusinessObjects
{
    public class SinhVien : XPObject
    {
        public SinhVien()
            : base()
        {
            // This constructor is used when an object is loaded from a persistent storage.
            // Do not place any code here.
        }

        public SinhVien(Session session)
            : base(session)
        {
            // This constructor is used when an object is loaded from a persistent storage.
            // Do not place any code here.
        }

        public override void AfterConstruction()
        {
            base.AfterConstruction();
            // Place here your initialization code.
        }

        //Fields
        string fMaSinhVien;
        [Size(50)]
        public string MaSinhVien
        {
            get { return fMaSinhVien; }
            set { SetPropertyValue<string>("MaSinhVien", ref fMaSinhVien, value); }
        }
        string fHoSinhVien;
        [Size(50)]
        public string HoSinhVien
        {
            get { return fHoSinhVien; }
            set { SetPropertyValue<string>("HoSinhVien", ref fHoSinhVien, value); }
        }
        string fTenSinhVien;
        [Size(10)]
        public string TenSinhVien
        {
            get { return fTenSinhVien; }
            set { SetPropertyValue<string>("TenSinhVien", ref fTenSinhVien, value); }
        }
        string fLopHoc;
        [Size(50)]
        public string LopHoc
        {
            get { return fLopHoc; }
            set { SetPropertyValue<string>("LopHoc", ref fLopHoc, value); }
        }

        NganhHoc fNganhHoc;
        [Association(@"SinhVienReferencesNganhHoc")]
        public NganhHoc NganhHoc
        {
            get { return fNganhHoc; }
            set { SetPropertyValue<NganhHoc>("NganhHoc", ref fNganhHoc, value); }
        }
        int fKhoaHoc;
        public int KhoaHoc
        {
            get { return fKhoaHoc; }
            set { SetPropertyValue<int>("KhoaHoc", ref fKhoaHoc, value); }
        }
        string fDienThoai;
        [Size(50)]
        public string DienThoai
        {
            get { return fDienThoai; }
            set { SetPropertyValue<string>("DienThoai", ref fDienThoai, value); }
        }
        string fEmail;
        public string Email
        {
            get { return fEmail; }
            set { SetPropertyValue<string>("Email", ref fEmail, value); }
        }
        [Association(@"SinhVienTrongNamReferencesSinhVien", typeof(SinhVienTrongNam))]
        public XPCollection<SinhVienTrongNam> SinhVienTrongNams { get { return GetCollection<SinhVienTrongNam>("SinhVienTrongNams"); } }
        [Association(@"SinhVienTrongCongTyReferencesSinhVien", typeof(SinhVienTrongCongTy))]
        public XPCollection<SinhVienTrongCongTy> SinhVienTrongCongTys { get { return GetCollection<SinhVienTrongCongTy>("SinhVienTrongCongTys"); } }
        [Association(@"SinhVienTrongGiangVienReferencesSinhVien", typeof(SinhVienTrongGiangVien))]
        public XPCollection<SinhVienTrongGiangVien> SinhVienTrongGiangViens { get { return GetCollection<SinhVienTrongGiangVien>("SinhVienTrongGiangViens"); } }
    }
}
